local spr = app.activeSprite
if not spr then
  return app.alert("There is no active sprite")
end

local info = debug.getinfo(1);
local str = info.source:sub(2)
local script_path = str:match("(.*\\)")

local handle = io.popen('MODE con: COLS=16 LINES=1 &  ' .. script_path .. 'ColorPicker.exe')
local color = handle:read("*a")
handle:close()



if (color) then
  local r, g, b = string.match(color, "(.*)%,(.*)%,(.*)")

  app.transaction(function()
      app.fgColor = Color{ r=r, g=g, b=b }
  end)
end